package priv.stones.entity;

import java.util.Date;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;
import java.util.List;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017-10-12
 */
@TableName("sys_menu")
public class SysMenu extends Model<SysMenu> {

    private static final long serialVersionUID = 1L;

    private String id;
    private String parentid;
    @TableField(exist = false)
    private String parentName;
    private String name;
    private Integer sort;
    /**
     * 1：可用 2：不可用
     */
    private Integer status;
    @TableField(exist = false)
    private String statusText;

    private String links;
    private Date createtime;
    /**
     * 1目录 2菜单 3按钮
     */
    private Integer category;
    @TableField(exist = false)
    private String categoryText;

    private String icon;
    private String privilegemark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentid() {
        return parentid;
    }

    public void setParentid(String parentid) {
        this.parentid = parentid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getLinks() {
        return links;
    }

    public void setLinks(String links) {
        this.links = links;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Integer getCategory() {
        return category;
    }

    public void setCategory(Integer category) {
        this.category = category;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPrivilegemark() {
        return privilegemark;
    }

    public void setPrivilegemark(String privilegemark) {
        this.privilegemark = privilegemark;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public String getStatusText() {
        switch (this.status) {
            case 1:
                return "可用";
            case 2:
                return "不可用";
            default:
                return "未知";
        }
    }

    public String getCategoryText() {
        switch (this.category) {
            case 1:
                return "目录";
            case 2:
                return "菜单";
            case 3:
                return "按钮";
            default:
                return "未知";
        }
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

}
